<template>
	<BaseContainer>
		<aplid-base-crud ref="crud" class="w-100" v-bind="options">
			<template v-slot:ArchivesDialog="{ row, show }">
				<Archives :api="baseConfig.api" :key="show" :nowRowData="row"></Archives>
			</template>
		</aplid-base-crud>
	</BaseContainer>
</template>

<script setup>
import { baseConfig } from '@/views/datacenter/basicData/practitioner/config'
import Archives from './Archives/index.vue'

const tableConfig = {
	stripe: true,
	border: true,
	maxHeight: '80vh',
	columns: [
		{ label: '单位所在地区', prop: 'unitAddress' },
		{ label: '单位名称', prop: 'unitName' },
		{ label: '身份证号', prop: 'idCard', plusXing: '2,2' },
		{ label: '姓名', prop: 'practitionersName' },
		{ label: '联系方式', prop: 'phone', plusXing: '5,2' },
		{
			label: '专职',
			prop: 'workTypeLabel',
			span: 8,
		},

		{
			label: '职业类型',
			prop: 'occupationTypeLabel',
		},
		{
			label: '文化程度',
			prop: 'cultureDegreeLabel',
		},
		{
			label: '在职状态',
			prop: 'serviceStateLabel',
			span: 8,
		},
		{ label: '入库时间', prop: 'createTime' },
		{
			label: '操作',
			prop: 'menu',
			width: 300,
			fixed: 'right',
		},
	],
}

const options = computed(() => {
	baseConfig.detailConfig.customeHeader.menuBtn = []
	return {
		...baseConfig,
    rowKey: 'recordUuid',
		api: {
			index: 'view_dpFoundationPractitionersFile_page',
		},
		auth: {
			index: 'view_dpFoundationPractitionersFile_page',
		},
    menuBtn: [
			{
				icon: 'editor',
				label: '查看档案',
				type: 'primary',
				operate: 'Archives',
				auth: '',
				text: true,
				show: true,
			},
		],
    tableConfig,
		menuAction: [],
		needPigeonhole: false,
		moreSearchConfig: undefined,
	}
})
</script>

<style lang="scss" scoped></style>
